<?php 
/**
 * @annotate 公司注册发送邮件 投递简历发送邮件 推荐简历 找回密码
 * @group   Home
 * @author   mengke.yue <mengke.yue@gmail.com>
 */
class MailAction extends BaseAction {
	public function sendMail($mail,$truename,$url){
   
    import('ORG.Mailer.Mail');
    //$con='请点击链接地址激活邮箱,链接地址是:'.$url.'/'.$code.'如果打开链接出错，请您复制地址在注册的浏览器上打开。我们还需努力，请谅解！';
    $con = "<html>
<meta http-equiv='content-type' content='text/html; charset=UTF-8' />
<head>
</head>
<body>
<div>
<div style='FONT-SIZE: 12px; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px'>
<div><br></div></div>
<table cellspacing='0' cellpadding='0' width='700' border='0'>
<tbody>
<tr>
<td style='FONT-SIZE: 14px; BORDER-TOP: #ea9413 3px solid; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px'>
<table cellspacing='0' cellpadding='0' width='700' border='0'>
<tbody>
<tr>
<td style='PADDING-BOTTOM: 10px'>
<div style='FONT-SIZE: 14px; LINE-HEIGHT: 28px'>您好，".$truename." 向您发送了一封简历！ </div>
<div style='FONT-SIZE: 14px; LINE-HEIGHT: 28px; TEXT-INDENT: 2em'>请点击下面链接，查看简历： </div>
<div style='FONT-SIZE: 14px; LINE-HEIGHT: 28px; TEXT-INDENT: 2em'>".$url."</div></td></tr>

<tr>
<table style='WIDTH: 700px; BORDER-BOTTOM: #d1d1d1 1px dotted'>
<tbody>

<tr>
<td style='PADDING-BOTTOM: 14px; FONT-SIZE: 15px; COLOR: #ff6600;PADDING-TOP: 10px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px'>人才来了，致力于帮你提升招聘效果及减轻您的招聘工作量。http://www.rencailaile.com/</td></tr>
</tbody></table>
<table style='WIDTH: 700px; BORDER-BOTTOM: #d1d1d1 1px dotted'>
<tbody>
<tr>
<td style='FONT-SIZE: 12px; COLOR: #aaa; PADDING-TOP: 8px' height='22'>您收到这封邮件是因为用户通过人才来了向您发送了一封简历。如果您不想收到此类邮件的话，可以点击<a href='' target='_blank'>退订此类邮件</a></td></tr>
<tr>
<td style='FONT-SIZE: 12px; COLOR: #aaa' height='22'>如有任何疑问，请拨打全国客服电话021-60520533 &nbsp; &nbsp;021-60520001。</td></tr>
<tr>
<td style='FONT-SIZE: 12px; COLOR: #aaa; PADDING-BOTTOM: 8px' height='22'>公司地址：上海浦东新区峨山路91弄58号陆家嘴软件园伟泰大厦8楼。</td></tr></tbody></table>
<table width='700'>
<tbody>
<tr>
<td style='FONT-SIZE: 12px; FONT-FAMILY: Arial; COLOR: #aaa' height='26'>上海言新网络科技有限公司  沪ICP备13040163号-1</td></tr></tbody></table></td></tr></tbody></table></div>
</body>
</html>
";

    SendMail($mail,'用户投递邮件',$con,'人才来了');
  }

  public function send_resume($mail,$cname,$jname,$uid){
    import('ORG.Mailer.Mail');
      $url ="http://www.yingyeyuan.com/";
      $data['uid'] = $uid;
    $area = D('area')->getField('area_id,title');
    $xueli = D('user_xueli')->getField('x_id,x_name');
    $nian = D('experience')->getField('life_id,life_name');
    $info = D('user_info')->where($data)->find();
    $info['t'] = date('Y-m-d',$info['ctime']);
    if(empty($info['xueli'])){
      $info['xue'] = "保密";
    }else{
      $info['xue'] = $xueli[$info['xueli']];
    }
    
    $resume = D('jobs_resume')->where($data)->find();
    $year = explode("-", $info['shengri']);
    $y = array_shift($year);
    $n = date("Y");
    if(empty($info['shengri'])){
      $info['she'] = "保密";
    }else{
    $info['she']= $n-$y;
  }
    $resume['xue'] = $xueli[$resume['eduxueli']];
    
    if($resume['english']==1){
      $resume['yu'] = "不会";
    }elseif($resume['english']==3){
      $resume['yu'] = "熟练应用";
    }else{
      $resume['yu'] = "基础交流";
    }
    if($resume['jingyan']==1){
      $info['nian'] = "保密";
    }elseif(empty($resume['jingyan'])){
      $info['nian'] = "保密";
    }else{
      $info['nian']= $nian[$resume['jingyan']];
    }
    if($info['xingbie']==1){
      $info['xing'] = "男";
    }else{
      $info['xing'] = "女";
    }
    switch ($info['hunyin'])
        {
        case 1:
          $info['hun'] = "未婚";
          break;
        case 2:
          $info['hun'] = "已婚";
          break;
        case 3:
          $info['hun'] = "已婚已育";
          break;
        default:
          $info['hun'] = "保密";
        }
    $info['xian_sheng']= $area[$info['pro']];
    $info['xian_shi']= $area[$info['city']];
    $info['xian_qu']= $area[$info['area']];
    $list = D('jobs_exper')->where($data)->select();
    foreach($list as $k=>$v){
      $coon .= "<tr>
<td style='FONT-SIZE: 14px; FONT-FAMILY: Arial' height='40' width='160' align='center'><strong>".$list[$k]['jobbegin']."--".$list[$k]['jobend']."</strong></td>
<td style='FONT-SIZE: 14px; PADDING-LEFT: 20px'><strong>".$list[$k]['jobname']."</strong></td></tr>
<tr>
<td rowspan='2'>&nbsp;</td>
<td style='FONT-SIZE: 14px; PADDING-LEFT: 20px' height='40'><strong>".$list[$k]['jobzhiwei']."</strong></td></tr>
<tr>
<td style='FONT-SIZE: 14px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; PADDING-LEFT: 20px; LINE-HEIGHT: 24px; PADDING-RIGHT: 20px'>".$list[$k]['jobtext']."</td></tr>";
    }
      $con = "
<html>
<meta http-equiv='content-type' content='text/html; charset=UTF-8' />
<head>
</head>
<body>
<div>
<div style='FONT-SIZE: 12px; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px'>
<div><br></div></div>
<table cellspacing='0' cellpadding='0' width='700' border='0'>
<tbody>
<tr>
<td style='FONT-SIZE: 14px; BORDER-TOP: #ea9413 3px solid; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px'>
<table cellspacing='0' cellpadding='0' width='700' border='0'>
<tbody>
<tr>
<td style='PADDING-BOTTOM: 10px'>
<div style='FONT-SIZE: 14px; LINE-HEIGHT: 28px'>尊敬的".$cname."，您好！ </div>
<div style='FONT-SIZE: 14px; LINE-HEIGHT: 28px; TEXT-INDENT: 2em'>您在海营之家招聘的职位： <span style='COLOR: #ff6600'>".$jname."</span> </div>
<div style='FONT-SIZE: 14px; LINE-HEIGHT: 28px; TEXT-INDENT: 2em'>收到一份人才简历，信息如下： </div></td></tr>
<tr>
<td style='FONT-SIZE: 12px; BORDER-TOP: #e2e2e2 1px solid; FONT-FAMILY: Arial; BORDER-RIGHT: #e2e2e2 1px solid; BORDER-BOTTOM: #e2e2e2 1px; COLOR: #999; PADDING-BOTTOM: 0px; TEXT-ALIGN: right; PADDING-TOP: 15px; PADDING-LEFT: 25px; BORDER-LEFT: #e2e2e2 1px solid; PADDING-RIGHT: 25px'>更新日期：<span style='border-bottom:1px dashed #ccc;' t='5' times=''>".$info['t']."</span> &nbsp; <a href='".$url."' target='_blank'>登录海营之家查看更多简历</a> </td></tr>
<tr>
<td style='BORDER-TOP: #e2e2e2 1px; BORDER-RIGHT: #e2e2e2 1px solid; BORDER-BOTTOM: #e2e2e2 1px dotted; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; PADDING-LEFT: 0px; BORDER-LEFT: #e2e2e2 1px solid; PADDING-RIGHT: 0px'>
<table>
<tbody cellpadding='0' cellspacing='0' border='0'>
<tr>
<th style='FONT-SIZE: 14px; COLOR: #666; PADDING-LEFT: 28px' height='40' colspan='4' align='left'>基本信息</th></tr>
<tr>
<td style='FONT-SIZE: 14px' height='30' valign='middle' width='144' align='right'>姓 名： </td>
<td style='FONT-SIZE: 14px' width='230'>".$info['truename']."</td>
<td style='FONT-SIZE: 14px' width='100' align='right'>工作年限： </td>
<td style='FONT-SIZE: 14px'>".$info['nian']."</td></tr>
<tr>
<td style='FONT-SIZE: 14px' height='30' valign='middle' align='right'>联系电话： </td>
<td style='FONT-SIZE: 14px; FONT-FAMILY: Arial'>".$info['phone']."</td>
<td style='FONT-SIZE: 14px' align='right'>性 别： </td>
<td style='FONT-SIZE: 14px'>".$info['xing']."</td></tr>
<tr>
<td style='FONT-SIZE: 14px' height='30' valign='middle' align='right'>现居地： </td>
<td style='FONT-SIZE: 14px; FONT-FAMILY: Arial'>".$info['xian_sheng']."-".$info['xian_shi']."-".$info['xian_qu']."</td>
<td style='FONT-SIZE: 14px' align='right'>年 龄： </td>
<td style='FONT-SIZE: 14px'>".$info['she']."</td></tr>
<tr>
<td style='FONT-SIZE: 14px' height='30' valign='middle' align='right'>婚姻状况： </td>
<td style='FONT-SIZE: 14px; FONT-FAMILY: Arial'>".$info['hun']."</td>
<td style='FONT-SIZE: 14px' align='right'>教育程度： </td>
<td style='FONT-SIZE: 14px'>".$info['xue']."</td></tr>

<tr>
<td height='10' colspan='4'></td></tr></tbody></table></td></tr>
<tr>
<td style='BORDER-TOP: #e2e2e2 1px; BORDER-RIGHT: #e2e2e2 1px solid; BORDER-BOTTOM: #e2e2e2 1px dotted; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; PADDING-LEFT: 0px; BORDER-LEFT: #e2e2e2 1px solid; PADDING-RIGHT: 0px'>
<table cellspacing='0' cellpadding='0' border='0'>
<tbody>
<tr>
<th style='FONT-SIZE: 14px; COLOR: #666; PADDING-LEFT: 30px' height='40' colspan='4' align='left'>自我介绍</th></tr>
<tr>
<td style='FONT-SIZE: 14px' height='30' colspan='4'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$resume['myinfo']."</td>
</tr>

<td height='10' colspan='4'></td></tr></tbody></table></td></tr>

<tr>
<td style='BORDER-TOP: #e2e2e2 1px; BORDER-RIGHT: #e2e2e2 1px solid; BORDER-BOTTOM: #e2e2e2 1px dotted; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; PADDING-LEFT: 0px; BORDER-LEFT: #e2e2e2 1px solid; PADDING-RIGHT: 0px'>
<table cellspacing='0' cellpadding='0' width='700' border='0'>
<tbody>
<tr>
<th style='FONT-SIZE: 14px; COLOR: #666; PADDING-LEFT: 30px' height='40' align='left'>工作经历</th></tr>
<tr>
<td style='PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 25px; PADDING-RIGHT: 25px' height='30' valign='middle'>
<table style='BORDER-COLLAPSE: collapse' bordercolor='#e2e2e2' cellspacing='0' cellpadding='0' width='650' border='1'>
<tbody>
".$coon."
</tbody></table></td></tr>
<tr>
<td height='10'></td></tr></tbody></table></td></tr>
<tr>
<td style='BORDER-TOP: #e2e2e2 1px; BORDER-RIGHT: #e2e2e2 1px solid; BORDER-BOTTOM: #e2e2e2 1px dotted; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; PADDING-LEFT: 0px; BORDER-LEFT: #e2e2e2 1px solid; PADDING-RIGHT: 0px'></td></tr>
<tr>
<td style='BORDER-TOP: #e2e2e2 1px; BORDER-RIGHT: #e2e2e2 1px solid; BORDER-BOTTOM: #e2e2e2 1px dotted; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; PADDING-LEFT: 0px; BORDER-LEFT: #e2e2e2 1px solid; PADDING-RIGHT: 0px'>
<table cellspacing='0' cellpadding='0' width='700' border='0'>
<tbody>
<tr>
<th style='FONT-SIZE: 14px; COLOR: #666; PADDING-LEFT: 30px' height='40' align='left'>教育经历</th></tr>
<tr>
<td style='PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 25px; PADDING-RIGHT: 25px' height='30' valign='middle'>
<table style='BORDER-COLLAPSE: collapse' bordercolor='#e2e2e2' cellspacing='0' cellpadding='0' width='650' border='1'>
<tbody>
<tr>
<td style='FONT-SIZE: 14px; FONT-FAMILY: Arial' height='40' width='160' align='center'><strong>".$resume['edubeigntime']."--".$resume['eduendtime']."</strong></td>
<td style='FONT-SIZE: 14px; PADDING-LEFT: 20px'><strong>".$resume['eduschool']."</strong></td></tr>
<tr>
<td rowspan='2'>&nbsp;</td>
<td style='FONT-SIZE: 14px; PADDING-LEFT: 20px' height='40'>- 学历：".$resume['xue']."</td></tr>
<tr>
<td style='FONT-SIZE: 14px; PADDING-LEFT: 20px' height='40'>- 专业描述：".$resume['edutext']."</td></tr></tbody></table></td></tr>
<tr>
<td height='10'></td></tr></tbody></table></td></tr>
<tr>
<td style='BORDER-TOP: #e2e2e2 1px; BORDER-RIGHT: #e2e2e2 1px solid; BORDER-BOTTOM: #e2e2e2 1px dotted; BORDER-LEFT: #e2e2e2 1px solid'>
<table style='MARGIN: 10px 0px' cellspacing='0' cellpadding='0' border='0'>
<tbody>
<tr>
<th style='FONT-SIZE: 14px; COLOR: #666; PADDING-LEFT: 30px' height='40' align='left'>培训</th></tr>
<tr>
<td style='FONT-SIZE: 14px; PADDING-LEFT: 30px' height='30' valign='middle'>".$resume['tratext']."</td></tr>
<tr>
<td height='10'></td></tr></tbody></table></td></tr>
<tr>
<td style='BORDER-TOP: #e2e2e2 1px; BORDER-RIGHT: #e2e2e2 1px solid; BORDER-BOTTOM: #e2e2e2 1px dotted; BORDER-LEFT: #e2e2e2 1px solid'>
<table style='MARGIN: 10px 0px' cellspacing='0' cellpadding='0' border='0'>
<tbody>
<tr>
<th style='FONT-SIZE: 14px; COLOR: #666; PADDING-LEFT: 30px' height='40' align='left'>英语能力</th></tr>
<tr>
<td style='FONT-SIZE: 14px; PADDING-LEFT: 30px' height='30' valign='middle'>
  ".$resume['yu']."</td></tr>
<tr>
<td height='10'></td></tr></tbody></table></td></tr>
<tr>
<td style='BORDER-TOP: #e2e2e2 1px; BORDER-RIGHT: #e2e2e2 1px solid; BORDER-BOTTOM: #e2e2e2 1px dotted; BORDER-LEFT: #e2e2e2 1px solid'></td></tr>
<tr>
<td style='BORDER-TOP: #e2e2e2 1px; BORDER-RIGHT: #e2e2e2 1px solid; BORDER-BOTTOM: #e2e2e2 1px dotted; BORDER-LEFT: #e2e2e2 1px solid'></td></tr>
<tr>
<td style='BORDER-TOP: #e2e2e2 1px; BORDER-RIGHT: #e2e2e2 1px solid; BORDER-BOTTOM: #e2e2e2 1px solid; PADDING-BOTTOM: 40px; PADDING-TOP: 20px; PADDING-LEFT: 0px; BORDER-LEFT: #e2e2e2 1px solid; PADDING-RIGHT: 0px'>
<table style='BORDER-TOP: #d98609 1px solid; HEIGHT: 34px; BORDER-RIGHT: #d98609 1px solid; WIDTH: 260px; BACKGROUND: #ea9413; BORDER-BOTTOM: #d98609 1px solid; BORDER-LEFT: #d98609 1px solid' cellspacing='0' cellpadding='0' align='center' border='0'>
<tbody>
<tr>
<td align='center'><a style='FONT-SIZE: 16px; TEXT-DECORATION: none; FONT-WEIGHT: bold; COLOR: #fff' href=".$url." target='_blank'>登录海营之家查看更多简历</a></td></tr></tbody></table></td></tr></tbody></table>
<table style='WIDTH: 700px; BORDER-BOTTOM: #d1d1d1 1px dotted'>
<tbody>
<tr>
<td style='FONT-SIZE: 12px; COLOR: #666; PADDING-BOTTOM: 14px; TEXT-ALIGN: right; PADDING-TOP: 10px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px'>注：此邮件为系统邮件，请勿直接回复。</td></tr></tbody></table>
<table style='WIDTH: 700px; BORDER-BOTTOM: #d1d1d1 1px dotted'>
<tbody>
<tr>
<td style='FONT-SIZE: 12px; COLOR: #aaa; PADDING-TOP: 8px' height='22'>您收到这封邮件是因为您注册了海营之家的账号或者订阅了相关邮件。如果您不想收到此类邮件的话，可以点击<a href='' target='_blank'>退订此类邮件</a></td></tr>
<tr>
<td style='FONT-SIZE: 12px; COLOR: #aaa' height='22'>如有任何疑问，请拨打全国客服电话021-60520533 &nbsp; &nbsp;021-60520001。</td></tr>
<tr>
<td style='FONT-SIZE: 12px; COLOR: #aaa; PADDING-BOTTOM: 8px' height='22'>公司地址：上海浦东新区峨山路91弄58号陆家嘴软件园伟泰大厦8楼。</td></tr></tbody></table>
<table width='700'>
<tbody>
<tr>
<td style='FONT-SIZE: 12px; FONT-FAMILY: Arial; COLOR: #aaa' height='26'>上海言新网络科技有限公司  沪ICP备13040163号-1</td></tr></tbody></table></td></tr></tbody></table></div>
</body>
</html>";
    
    SendMail($mail,'海营之家简历查看',$con,'海营之家');
  }
}
?>